package com.chinasofti.optional;

import java.util.Optional;

public class Demo01 {
    public static void main(String[] args) {

//        method1();
        Student student = null;
        Optional<Student> optional =Optional.ofNullable(student);
        System.out.println(optional);
    }

    private static void method1() {
        //        Student s = new Student();
//        s.setName("张三");
//        s.setAge(13);
        Student s = null;
        Optional<Student> optional = Optional.of(s);
        System.out.println(optional);
    }
}
